package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * IeFuente generated by hbm2java
 */
@Entity
@Table(name = "IE_FUENTE", schema = "UPET")
public class IeFuente implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3095926219101327128L;
	private String cfuente;
	private String dfuente;
	private String cusuario;
	private Date fhingreso;
	private Integer bstatus;
	private Set<IeSolicitud> ieSolicituds = new HashSet<IeSolicitud>(0);
	private Set<IeFuenteDocdef> ieFuenteDocdefs = new HashSet<IeFuenteDocdef>(0);

	public IeFuente() {
	}

	public IeFuente(String cfuente, String dfuente, String cusuario,
			Date fhingreso) {
		this.cfuente = cfuente;
		this.dfuente = dfuente;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
	}

	public IeFuente(String cfuente, String dfuente, String cusuario,
			Date fhingreso, Integer bstatus, Set<IeSolicitud> ieSolicituds,
			Set<IeFuenteDocdef> ieFuenteDocdefs) {
		this.cfuente = cfuente;
		this.dfuente = dfuente;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.bstatus = bstatus;
		this.ieSolicituds = ieSolicituds;
		this.ieFuenteDocdefs = ieFuenteDocdefs;
	}

	@Id
	@Column(name = "C_FUENTE", unique = true, nullable = false,  insertable = true,  updatable = true, length = 30)
        @NotEmpty(message="{NotEmpty.IeFuente.cfuente}")
	public String getCfuente() {
		return this.cfuente;
	}

	public void setCfuente(String cfuente) {
		this.cfuente = cfuente;
	}

	/**
     *
     * @return
     */
    @Column(name = "D_FUENTE", unique = false, nullable = false, insertable = true, updatable = true, length = 255)
        @NotEmpty
	public String getDfuente() {
		return this.dfuente;
	}

	public void setDfuente(String dfuente) {
		this.dfuente = dfuente;
	}

	@Column(name = "C_USUARIO", unique = false, nullable = false, insertable = true, updatable = true, length = 30)
        @NotEmpty
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO",  unique = false, nullable = false, insertable = true, updatable = true, length = 7)
        @NotNull
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Column(name = "B_STATUS", nullable = false, precision = 1, scale = 0)
	public Integer getBstatus() {
		return this.bstatus;
	}

	public void setBstatus(Integer bstatus) {
		this.bstatus = bstatus;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ieFuente")
	public Set<IeSolicitud> getIeSolicituds() {
		return this.ieSolicituds;
	}

	public void setIeSolicituds(Set<IeSolicitud> ieSolicituds) {
		this.ieSolicituds = ieSolicituds;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ieFuente")
	public Set<IeFuenteDocdef> getIeFuenteDocdefs() {
		return this.ieFuenteDocdefs;
	}

	public void setIeFuenteDocdefs(Set<IeFuenteDocdef> ieFuenteDocdefs) {
		this.ieFuenteDocdefs = ieFuenteDocdefs;
	}
}
